<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>修改角色菜单</title>
<!--公共样式开始-->
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/reset.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/common.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Plugins/FontAwesome/css/font-awesome.min.css">
<!--公共样式结束-->
<!--页面样式开始-->
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/ztree.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/module_form.css">
<!--页面样式结束-->
<!--公共JS开始-->
<script src="{$NOW_THEME_URL}/Assets/Js/jquery.min.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Js/jquery.timer.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Js/common.js"></script>
<!--公共JS结束-->
<!--ZTree开始-->
<link rel="stylesheet" href="{$NOW_THEME_URL}/Assets/Plugins/ZTree/css/zTreeStyle/zTreeStyle.css" type="text/css">
<include file="treeMenu" />
<script type="text/javascript" src="{$NOW_THEME_URL}/Assets/Plugins/ZTree/js/jquery.ztree.core-3.5.js"></script>
<script type="text/javascript" src="{$NOW_THEME_URL}/Assets/Plugins/ZTree/js/jquery.ztree.excheck-3.5.js"></script>
<script type="text/javascript" src="{$NOW_THEME_URL}/Assets/Plugins/ZTree/js/jquery.ztree.exhide-3.5.js"></script>
<!--ztree结束-->
<style type="text/css">
	body {
		overflow:hidden;
	}
	.table_box {
	}
</style>
</head>

<body>
	<div class="quanxian clearfix">
		<div class="quanxian_left">
			<div class="tb_title">基本信息</div>
			<form action="" method="post" id="memberAdd_form">
			<input type="hidden" name="id" id="dataid" value="{$detail.id}" />
			<table border="0" cellpadding="0" cellspacing="0" class="module_form">
				<tr>
					<td>名称：</td>
					<td><input name="title" value="{$detail.title}" id="title" type="text" class="form_ele_text width_200"></td>
				</tr>
				<tr>
					<td>排序号：</td>
					<td><input name="sort" id="sort"  value="{$detail.sort}" type="text" class="form_ele_text width_200"></td>
				</tr>
				<tr>
					<td>备注：</td>
					<td><textarea class="width_200" name="remark" id="remark">{$detail.remark}</textarea></td>
				</tr>
			</table>
			</form>
		</div>
		<div class="quanxian_right">
			<div class="tb_title">菜单设置[√可为快捷方式]</div>
			<ul id="treeDemo" class="ztree"></ul>
		</div>
	</div>
	<div class="page_footer pdtd10">
		<input type="button" name="submit" value="提  交"  class="form_ele_submit"/>
		<input type="reset"  name="reset"  value="取  消"  class="form_ele_reset"/>
	</div>
	
	<script type="text/javascript">
	//弹出窗口全局变量
	var api = frameElement.api, W = api.opener;

	$(function(){
		//重置
		$('.form_ele_reset').on('click',function(){
			frameApi.close(); //关闭当前窗口
		});
		
		//提交
		$('.form_ele_submit').on('click',function(){
			
			var nodes  = getSelectedNode("treeDemo");
			var select = {}; 
			$(nodes).each(function(i){
				var id   = nodes[i]['id'];
				var name = nodes[i]['name'];
				select[id] = id;
			});
			
			//通过POST直接提交表单
			var tipsObj = windowApi.lhgdialog.tips('正在提交数据...',10,etIcon.loading);
		
			//var postData = $('#memberAdd_form').serialize();
			//通过Ajax提交表单	
			var postData = {};
			postData.id	    = $('#dataid').val();
			postData.title  = $('#title').val();
			postData.remark = $('#remark').val();
			postData.sort   = $('#sort').val();
			postData.node   = select;
			
			$.post("__URL__/roleMenu", postData ,
				function(data){
					tipsObj.close();
					windowApi.lhgdialog.tips('修改角色菜单成功！',1,etIcon.success,function(data){
						frameApi.close(); //关闭当前窗口
					});
				}, "json"
			);
		});
	});
</script>
	
	
</body>
</html>
